home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / TVMENU2 / READ.ME < prev   
Text File  |  1992-07-20  |  3KB  |  65 lines

  1. On joining Compuserve, I looked at the ideas available for adapting Turbo
  2. Vision and was interested to see Danny Thorpe's TVMENU files.  After giving
  3. this implementation a go, I felt that using three commands to Mark, Set and
  4. Clear the tick mark was a bit cumbersome.  I also perferred the way Windows
  5. tackles the problem.
  6.  
  7. This implementation, then, is more akin to the Windows approach of being
  8. able to place or remove a check mark from alongside the text of a menu item
  9. by calling a function.  These functions are contained in MENUTICK.PAS.
  10.  
  11. Implementation
  12. --------------
  13. Ideally, it would have been possible to override TMenuItem to add an
  14. additional check mark field.  However, for some reason, the innards of the TV
  15. menuing system make use of linked lists of records instead of objects, making
  16. it difficult to override the functionality of the menu system without
  17. replacing key aspects of it.
  18.  
  19. Instead, an additional menu function (NewCheckItem) has been fashioned to
  20. automatically make space at the beginning of the menu item's NAME for some
  21. kind of mark.  If the CHECKED parameter of this function is true, the menu
  22. item is pre-set as being checked.  The default check mark is '√' (Ascii 251)
  23. and the default clear mark is a space.  Both of these can be changed by
  24. changing the global constants CHECKMARK and CLEARMARK defined in unit
  25. MENUTICK.
  26.  
  27. MENUTICK also defines four functions able to manipulate this checked state
  28. of a menu item.  These are:
  29.  
  30.    CheckMenuItem       - Puts the check mark into the Name field of the menu
  31.                          item and returning True if it could.  If False is
  32.                          returned, the most likely causes are that the menu
  33.                          item is already checked or that a menu item with
  34.                          a the given command (see below) does not exist.
  35.    ClearMenuItem       - The exact opposite of the above.
  36.    MenuItemIsChecked   - Returns true if a menu item with the given command
  37.                          constant exists and is checked.  If it does exist but
  38.                          is not checked false will be returned.  It a menu
  39.                          item with the given command constant does not exist
  40.                          or is disabled, the function will return False and
  41.                          set the Command parameter to zero.
  42.    ToggleMenuItem      - This function just flips the clear/checked set
  43.                          in the specified menu and returns the previous
  44.                          state as a boolean.
  45.  
  46. Each of the functions takes two paramters:
  47.  
  48.    AMenu   : PMenuItem - Usually this will be the Menu field of the global
  49.                          variable MenuBar that is defined in TV unit APP.
  50.    Command : Word;     - The cmXXX constant associated with a menu item.
  51.  
  52. If you find it useful, please make free (or commercial) use of it.
  53.  
  54.  
  55. Acknowledgements:
  56.  
  57. MENUTICK.PAS continues to use Danny Thorpe's function that locates a
  58. specific menu option.  This has been renamed FindMenuItem.
  59.  
  60.  
  61.  
  62. Bill Seddon 20th July 1992
  63.  
  64. Compuserve 100111,557
  65.